/***************************************************************************
                        mirrors.h  -  Part of gltris
                             -------------------
    begin                : May 2001
    copyright            : (C) 2001 by David Delbecq (Alias Tchize)
    email                : david.delbecq@usa.net
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/****************************************************************************
* See associated .c file for functions description.                         *
****************************************************************************/
#ifndef _mirrors_h_
#define _mirrors_h_
#include "defs.h"

#define MaxMirrors 1
/*Mirrors system is still in developpement. Recommended not to use more than one*/
#define MaxMirrorsRecursion 0

#define MUTUAL_HIDE(mirror1,mirror2)\
        mirrors[mirror1].forbidden[mirror2]=true;\
        mirrors[mirror2].forbidden[mirror1]=true;
#define IS_VISIBLE(source,mirror) (((source>=0)&&(mirror>=0))?!(mirrors[source].forbidden[mirror]):true)

typedef struct
     {
     GLfloat alpha, beta;
     GLfloat distance;
     /*vecteur predecal;*/
     vecteur postdecal;
     callback_void drawer, stencildrawer;
     boolean forbidden [MaxMirrors];
     } TMirror;
     /*
     Note: the drawer of the mirror must be so that the mirror
     faces Z coordinates.
     */
extern TMirror mirrors[MaxMirrors];
void RefreshMirror (int mirrornumber, int stencil);
void DrawMirror (int mirrornumber, int stencil, int oldstencil);
void CleanMirror (int mirrornumber, int stencil, int oldstencil);
#endif
